
#ifndef _COMM_LIB_H_
#define _COMM_LIB_H_
#define SELF_TEST
#ifdef __cplusplus 
extern "C"
{
#endif

#define COMM_LIB_FLAGS_SEND_ENABLE		(1<<1)
#define COMM_LIB_FLAGS_RECV_ENABLE		(1<<2)

typedef int (*fn_comm_recv_cb)(void* fd, unsigned char* buf, int buf_len);

typedef struct comm_start_config_t
{
	int flags;

	char* send_ip;
	unsigned int send_port;

	unsigned int recv_port;
	fn_comm_recv_cb pfn_comm_recv_cb;
} comm_start_config_t;

	int comm_start(comm_start_config_t config);
	int comm_send(void* fd, unsigned char* buf, int buf_len);

#ifdef __cplusplus 
}
#endif

#endif /* _COMM_LIB_H_ */